package org.linlinjava.litemall.db.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.SysPerm;
import org.linlinjava.litemall.db.domain.SysPermExample;

public interface SysPermMapper {
    /**
     * 根据用户id查询菜单权限
     * @param userId
     * @return
     */
    List<Map> getPermsByUserId(@Param("userId")Integer userId);
    /**
     * 查询角色对应的所有权限
     * @param roleId
     * @return
     */
    List<SysPerm> getPermsByRoleId(@Param("roleId")Integer roleId);
    /**
     * 批量保存实体
     * @param perms
     */
    void saveOrUpdate(@Param("perms")List<SysPerm> perms);
    /**
     * 通过权限类型删除对应的数据
     * @param ptype
     * @return
     */
     int deleteByptype(Integer ptype);
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    long countByExample(SysPermExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int deleteByExample(SysPermExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(String pval);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int insert(SysPerm record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int insertSelective(SysPerm record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    SysPerm selectOneByExample(SysPermExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    SysPerm selectOneByExampleSelective(@Param("example") SysPermExample example, @Param("selective") SysPerm.Column ... selective);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    List<SysPerm> selectByExampleSelective(@Param("example") SysPermExample example, @Param("selective") SysPerm.Column ... selective);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    List<SysPerm> selectByExample(SysPermExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     * @project https://github.com/itfsw/mybatis-generator-plugin
     */
    SysPerm selectByPrimaryKeySelective(@Param("pval") String pval, @Param("selective") SysPerm.Column ... selective);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    SysPerm selectByPrimaryKey(String pval);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") SysPerm record, @Param("example") SysPermExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") SysPerm record, @Param("example") SysPermExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(SysPerm record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_perm
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(SysPerm record);
}